<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>

        <f:metadata>
            <f:event type="preRenderView" listener="#{u_memberManagedBean.verifyLogin('admin')}"/>
        </f:metadata>

        <ui:insert name="header"/>

        <!-- CSS -->
        <h:outputStylesheet library="admin/css" name="layout.css"/>

        <!-- JS -->        
        <h:outputScript library="admin/js" name="hideshow.js"/>
        <h:outputScript library="admin/js" name="jquery.tablesorter.min.js"/>
        <h:outputScript library="admin/js" name="jquery.equalHeight.js"/>

        <script type="text/javascript">
            $(document).ready(function()
            {
                $(".tablesorter").tablesorter();
            }
            );
            $(document).ready(function() {

                //When page loads...
                $(".tab_content").hide(); //Hide all content
                $("ul.tabs li:first").addClass("active").show(); //Activate first tab
                $(".tab_content:first").show(); //Show first tab content

                //On Click Event
                $("ul.tabs li").click(function() {

                    $("ul.tabs li").removeClass("active"); //Remove any "active" class
                    $(this).addClass("active"); //Add "active" class to selected tab
                    $(".tab_content").hide(); //Hide all tab content

                    var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
                    $(activeTab).fadeIn(); //Fade in the active ID content
                    return false;
                });

            });
        </script>

        <script type="text/javascript">
            $(function() {
                $('.column').equalHeight();
            });
        </script>

    </h:head>
    <h:body>
        <header id="header">
            <hgroup>
                <h1 class="site_title"><a href="index.html">Website Admin</a></h1>
                <h2 class="section_title">Dashboard</h2><!--<div class="btn_view_site"><a href="http://www.medialoot.com">View Site</a></div>-->
            </hgroup>
        </header> <!-- end of header bar -->

        <section id="secondary_bar">
            <div class="user">
                <p>John Doe (<a href="#">3 Messages</a>)</p>
                <!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
            </div>
            <div class="breadcrumbs_container">
                <article class="breadcrumbs"><a href="index.html">Website Admin</a> <div class="breadcrumb_divider"></div> <a class="current">Dashboard</a></article>
            </div>
        </section><!-- end of secondary bar -->

        <aside id="sidebar" class="column">
            <form class="quick_search">
                <input type="text" value="Quick Search" onfocus="if (!this._haschanged) {
                    this.value = ''
                }
                ;
                this._haschanged = true;"/>
            </form>
            <hr/>
            <h3>Users</h3>
            <ul class="toggle">
                <li class="icn_add_user"><a href="#">Add New User</a></li>
                <li class="icn_view_users"><a href="#">View Users</a></li>
                <li class="icn_profile"><a href="#">Your Profile</a></li>
                <li class="icn_jump_back">
                    <h:form>
                        <h:commandLink id="logout" value="Log Out" action="#{u_memberManagedBean.logout('admin')}"/>
                    </h:form>
                </li>
            </ul>
            <h3>Management</h3>
            <ul class="toggle">
                <c:forEach var="page" items="#{a_rightsManagedBean.rightsFacade.findAll()}">
                    <li class="icn_folder"><h:link value="${page.name}" outcome="${page.name}.xhtml"/></li>
                </c:forEach>
            </ul>
            <footer>
                <hr />
                <p><strong>Copyright &copy; 2011 Website Admin</strong></p>
                <p>Theme by <a href="http://www.medialoot.com">MediaLoot</a></p>
            </footer>
        </aside><!-- end of sidebar -->

        <section id="main" class="column">

            <ui:insert name="context"/>

        </section>
    </h:body>
</html>

